#ifndef BARRIER_H
#define BARRIER_H

#include <QPixmap>
#include <QRect>

class barriers{
public:
    barriers();
    virtual void updateposition()=0;
    virtual void updatebarrierpositionY()=0;
    virtual bool isout()=0;
    virtual int collectdetection(QRect)=0;
    virtual QPixmap getImg(int)=0;
public:
    int x,y;
    QPixmap img;
    QRect rect;
};

//派生交互及障碍物
class qp:public barriers
{
public:
    qp(int);
    void updateposition();
    void updatebarrierpositionY(){}
    bool isout();
    int collectdetection(QRect);
    QPixmap getImg(int);
};
class stone:public barriers
{
public:
    stone();
    void updateposition();
    void updatebarrierpositionY(){}
    bool isout();
    int collectdetection(QRect);
    QPixmap getImg(int);
};
class gudazi:public barriers
{
public:
    gudazi();
    void updateposition();
    void updatebarrierpositionY();
    bool isout();
    int collectdetection(QRect);
    QPixmap getImg(int);
public:
    QPixmap img2;
    double t=0;
    double u;
    //t,u作为运动的余弦函数时间变量和初相
};
class Merlin:public barriers
{
public:
    Merlin();
    void updateposition();
    void updatebarrierpositionY(){}
    bool isout();
    int collectdetection(QRect);
    QPixmap getImg(int);
public:
    QPixmap img2;
};
#endif // BARRIER_H
